package com.water.fish.utils

import android.content.Context
import kotlin.random.Random

/**
 * Created by zxn on 2021/12/10.
 */
/**
 * dp转px
 *
 * @param context context
 * @param dpValue dp值
 * @return px值
 */
fun dp2px(context: Context, dpValue: Float): Float {
    val scale = context.resources.displayMetrics.density
    return (dpValue * scale + 0.5f)
}